<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
    <!-- #section:basics/sidebar -->
    <div id="sidebar" class="sidebar responsive">
        <script type="text/javascript">
            try {
                ace.settings.check('sidebar', 'fixed')
            } catch (e) {
            }
        </script>

        <div class="sidebar-shortcuts" id="sidebar-shortcuts">
            <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
                <button class="btn btn-success">
                    <i class="ace-icon fa fa-signal"></i>
                </button>

                <button class="btn btn-info">
                    <i class="ace-icon fa fa-pencil"></i>
                </button>

                <!-- #section:basics/sidebar.layout.shortcuts -->
                <button class="btn btn-warning">
                    <i class="ace-icon fa fa-users"></i>
                </button>

                <button class="btn btn-danger">
                    <i class="ace-icon fa fa-cogs"></i>
                </button>

                <!-- /section:basics/sidebar.layout.shortcuts -->
            </div>

            <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
                <span class="btn btn-success"></span>

                <span class="btn btn-info"></span>

                <span class="btn btn-warning"></span>

                <span class="btn btn-danger"></span>
            </div>
        </div><!-- /.sidebar-shortcuts -->

        <ul class="nav nav-list">
            <?php foreach ($menu as $key=>$v) :?>
                <li
                <?php if(($v['id'] == $current['id']) OR ($v['id'] == $current['pid']) OR ($v['id'] == $current['ppid'])) : ?>
                    class="active <?php if($current['pid'] != 0) :?>open<?php endif;?>"
                <?php endif;?>
                >
                <a href="<?php if(empty($v['name'])) : ?>#<?php else : ?><?php echo site_url(X_URL.$v['name']);?><?php endif;?>"
                    <?php if(!empty($v['children'])):?>class="dropdown-toggle"<?php endif;?>
                >
                    <?php if(!empty($v['icon'])):?><i class="menu-icon fa <?php echo $v['icon']?>"></i><?php endif;?>
                <span class="menu-text"><?php echo $v['title']?></span>
                    <?php if(!empty($v['children'])):?><b class="arrow fa fa-angle-down"></b><?php endif;?>
                </a>

                <b class="arrow"></b>
                    <?php if(!empty($v['children'])):?>
                    <ul class="submenu">
                        <?php foreach ($v['children'] as $kk=>$vv) :?>
                            <li
                        <?php if(($vv['id'] == $current['id']) OR ($vv['id'] == $current['pid']) OR ($vv['id'] == $current['ppid'])) : ?>
                            class="active <?php if($current['ppid'] != 0) :?>open<?php endif;?>"
                        <?php endif;?>
                        >
                            <a href="<?php if(empty($vv['name'])) : ?>#<?php else : ?><?php echo site_url(X_URL.$vv['name']);?><?php endif;?>"
                                <?php if(!empty($vv['children'])):?>class="dropdown-toggle"<?php endif;?>
                            >
                                <?php if(!empty($vv['icon'])):?>
                                    <i class="menu-icon fa <?php echo $vv['icon']?>"></i>
                                <?php endif;?>
                                <?php echo $vv['title']?>
                                <?php if(!empty($vv['children'])):?>
                                    <b class="arrow fa fa-angle-down"></b>
                                <?php endif;?>
                            </a>

                            <b class="arrow"></b>
                                <?php if(!empty($vv['children'])):?>
                                <ul class="submenu">
                                        <?php foreach ($vv['children'] as $kkk=>$vvv) :?>
                                        <li
                                        <?php if($vvv['id'] == $current['id']) :?>class="active"<?php endif;?>
                                        >
                                        <a href="<?php echo site_url(X_URL.$vvv['name']);?>">
                                            <?php if(!empty($vvv['icon'])):?>
                                            <i class="<?php echo $vvv['icon']?>"></i>
                                            <?php endif;?>
                                            <?php echo $vvv['title']?>
                                        </a>
                                        <b class="arrow"></b>
                                        </li>
                                    <?php endforeach;?>
                                </ul>
                                <?php endif;?>
                            </li>

                        <?php endforeach;?>
                    </ul>
                    <?php endif;?>
                </li>
            <?php endforeach;?>

        </ul><!-- /.nav-list -->

        <!-- #section:basics/sidebar.layout.minimize -->
        <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
            <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left"
               data-icon2="ace-icon fa fa-angle-double-right"></i>
        </div>

        <!-- /section:basics/sidebar.layout.minimize -->
        <script type="text/javascript">
            try {
                ace.settings.check('sidebar', 'collapsed')
            } catch (e) {
            }
        </script>
    </div>

    <!-- /section:basics/sidebar -->